using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerArrow : MonoBehaviour
{
    private Arrow arrow;
    private void Awake()
    {
        arrow = GameObject.FindWithTag("Arrow").GetComponent<Arrow>();
    }

    public void ShootArrow(Vector2 velocity,Vector3 spawnOffSet)
    {
        GameObject o;
        (o = arrow.gameObject).GetComponent<Rigidbody2D>().simulated = true;
        o.transform.position = transform.position + spawnOffSet;
        arrow.gameObject.SetActive(true);
        arrow.GetComponent<Rigidbody2D>().velocity = velocity;
    }

    public void RecycleArrow()
    {
        arrow.gameObject.SetActive(false);
    }
    
}
